using UnityEngine;
// [Assembly-CSharp.dll].Glass
public class Glass : MonoBehaviour
{
    
    #region Glass.<Breaking>d__7
    // [Assembly-CSharp.dll].Glass.<Breaking>d__7
    private sealed class _Breaking_d__7 : IEnumerator<object>, IEnumerator, IDisposable
    {
        // Fields
        private int __1__state;
        private object __2__current;
        public Glass __4__this;
        
        // Properties
        private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
        private object System.Collections.IEnumerator.Current { get; }
        
        // Methods
        public _Breaking_d__7(int __1__state)
        {
            this.__1__state = __1__state;
        }
        private void System.IDisposable.Dispose()
        {
        
        }
        private bool MoveNext()
        {
            Glass val_4 = this.__4__this;
            if(this.__1__state == 2)
            {
                goto label_1;
            }
            
            if(this.__1__state == 1)
            {
                goto label_2;
            }
            
            if(this.__1__state != 0)
            {
                    return true;
            }
            
            this.__1__state = 0;
            if(this.__4__this.uiManager.timer < 0)
            {
                    return true;
            }
            
            UnityEngine.WaitForSeconds val_1 = 536895821;
            val_4 = val_1;
            val_1 = new UnityEngine.WaitForSeconds(seconds:  1f);
            this.__2__current = val_4;
            this.__1__state = 1;
            return true;
            label_1:
            this.__1__state = 0;
            mem[536882947] + 64.Play();
            UnityEngine.Object.Destroy(obj:  val_4.gameObject);
            return true;
            label_2:
            this.__1__state = 0;
            mem[536882947] + 64.Play();
            this.__4__this.mSprite.sprite = this.__4__this.breakingSprite;
            UnityEngine.WaitForSeconds val_3 = 536895821;
            val_4 = val_3;
            val_3 = new UnityEngine.WaitForSeconds(seconds:  1f);
            this.__2__current = val_4;
            this.__1__state = 2;
            return true;
        }
        private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
        {
            return (object)this.__2__current;
        }
        private void System.Collections.IEnumerator.Reset()
        {
            27351792 = new System.NotSupportedException();
            throw 27351792;
        }
        private object System.Collections.IEnumerator.get_Current()
        {
            return (object)this.__2__current;
        }
    
    }
    
    #endregion
    
    // Fields
    private bool isBreaking;
    private UnityEngine.SpriteRenderer mSprite;
    private UIManager uiManager;
    public UnityEngine.Sprite breakingSprite;
    
    // Methods
    private void Start()
    {
        this.uiManager = UnityEngine.Object.FindObjectOfType<System.Object>();
        this.mSprite = this.GetComponent<System.Object>();
    }
    private void Update()
    {
    
    }
    private void OnCollisionEnter2D(UnityEngine.Collision2D collision)
    {
        UnityEngine.Collision2D val_15 = collision;
        if(((System.String.op_Equality(a:  val_15.gameObject.tag, b:  -1610608115)) != true) && ((System.String.op_Equality(a:  val_15.gameObject.tag, b:  -1610609439)) != true))
        {
                if((System.String.op_Equality(a:  val_15.gameObject.tag, b:  -1610605719)) != true)
        {
                val_15 = 27514800;
            if((System.String.op_Equality(a:  val_15.gameObject.tag, b:  -1610603609)) == false)
        {
                return;
        }
        
        }
        
        }
        
        if(this.isBreaking != false)
        {
                return;
        }
        
        this.isBreaking = true;
        UnityEngine.Coroutine val_14 = this.StartCoroutine(routine:  this.Breaking());
    }
    private System.Collections.IEnumerator Breaking()
    {
        object val_1 = 536898839;
        val_1 = new System.Object();
        mem[536898855] = 0;
        mem[536898871] = this;
        return (System.Collections.IEnumerator)val_1;
    }
    public Glass()
    {
    
    }

}
